package top.minishow.pdf.controller;

import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: robin he
 * @Date: 2021/10/12 14:16
 * @Desc:
 */
@RequestMapping
@RestController
public class MailTest {
    @GetMapping("/sendMail")
    public String main() {
        MailAccount account = new MailAccount();
        account.setHost("smtp.office365.com");
        account.setPort(587);
        account.setAuth(true);
        account.setFrom("quectelsrm@quectel.com");
        account.setUser("quectelsrm@quectel.com");
        account.setPass("Admin@123456");
        account.setStartttlsEnable(true);
        account.setSslEnable(false);
        MailUtil.send(account, "1540812323@qq.com", "测试66", "测试邮件发送4545", false);
        return "aa";
    }
}
